<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let arr = [5, 1, 6, 7, 8, 9, 8, 2]
        function i() {
            arr.sort(function (a, b) {
                return a - b
            })
            console.log(arr[0])
        }
        i()
    </script>
</body>

</html>